package com.schoolcloud.share.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.schoolcloud.common.model.PageDTO;
import com.schoolcloud.share.entity.Tags;
import com.schoolcloud.share.query.TagsQuery;
import com.schoolcloud.share.service.TagsService;
import com.schoolcloud.share.mapper.TagsMapper;
import com.schoolcolud.daomybatisplus.dto.MpPageUtil;
import org.springframework.stereotype.Service;

/**
* @author hongmizfb
* @description 针对表【tags(内容标签系统)】的数据库操作Service实现
* @createDate 2025-05-16 18:35:15
*/
@Service
public class TagsServiceImpl extends ServiceImpl<TagsMapper, Tags>
    implements TagsService{

    @Override
    public PageDTO<Tags> getTagPage(TagsQuery query) {
        String name = query.getName();
        Page<Tags> page = lambdaQuery().like(name != null, Tags::getName, name)
                .page(query.toMpPage());
        return MpPageUtil.of(page, Tags.class);
    }
}




